<template>
  <el-form class="list-b-12 p-12 m-8 bg-color-white" :model="dataInfo.form" label-width="auto" ref="ruleFormRef"
    @submit.prevent="">
    <ElFormItemBox label="复制内容">
      {{ data.copy || '--' }}
    </ElFormItemBox>
    <el-divider border-style="dashed" />
    <ElFormItemBox label="选择生产单">
      <CopyBox :data='`<SelectProduction @selectBtn="selectBtn" :setObj="{}"/>`' @copyBtn="copyBtn">
        <SelectProduction @selectBtn="selectBtn" :setObj="{
          produceTaskBillNo: 'produceTaskBillNo',
          createDateNew: 'createDate',
        }" />
      </CopyBox>
    </ElFormItemBox>
    <ElFormItemBox label="选中内容">
      <ListBox :data="data.list" />
    </ElFormItemBox>
  </el-form>
</template>
<script setup lang="ts">
import { useListComponent } from './pageTs'; // 引入逻辑
const { dataInfo } = useListComponent();
import { reactive, onMounted, onBeforeUnmount, getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance() as any;
const data = reactive({
  copy: '',
  list: null,
});
const ruleFormRef = ref<HTMLElement | null>(null);
const copyBtn = (text: string) => {
  data.copy = text
};
const selectBtn = (row: any) => {
  data.list = row
};
onMounted(() => { });

onBeforeUnmount(() => { });
</script>